<?php

namespace app\modules\setting\controllers\fsjl;

use Yii;
use app\modules\setting\models\fsjl\EtcSendCreatorDetail;
use app\modules\setting\configs\fsjl\FsjlConfig;
use app\modules\setting\models\fsjl\EtcSendCreatorDetailSearch;
use sookie\react\AdminController;
use yii\helpers\ArrayHelper;
use yii\helpers\Json;
use yii\base\Exception;
use sookie\excel\SaveExcel;
use sookie\db\DBHandler;


/**
 * FsjlController implements the CRUD actions for EtcSendCreatorDetail model.
 */
class FsjlController extends AdminController
{
    /**
    * @return array
    * 列表数据
    */
    public function actionIndex()
    {
        try {
            $searchModel = new EtcSendCreatorDetailSearch();
            $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
            return ArrayHelper::merge(["data" =>$dataProvider->getModels(), "pagination" => $dataProvider->getPagination()],FsjlConfig::configIndex());
        }catch (\Throwable $e){
            return ["ok" => false,"msg" => $e->getMessage(),"code" => 401];
        }
    }






    protected function findModel($id)
    {
        if (($model = EtcSendCreatorDetail::findOne($id)) !== null) {
            return $model;
        }

        throw new Exception('不存在的记录');
    }




}

